home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Video Toaster 4.3
/
Video Toaster v4.3.iso
/
3.1
/
toasterall
/
arexx_examples
/
timelapse.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1993-06-06
|
2KB
|
53 lines
/* TimeLapse.rexx -- Record frames at intervals of 1 to 60 mins */
/* By Arnie Cachelin © 1992 NewTek Inc. */
OPTIONS RESULTS
TOASTERLIB="ToasterARexx.port"
REXXLIB = "rexxsupport.library"
arg delay count name
if arg()=0 then do
say "USAGE: rx TimeLapse <delay in mins> <# of frames> <name>"
exit
end
if delay="" then delay = 1
if delay<1 then delay = 1
if delay>60 then delay = 60
if count="" then count=10
if count>1000 then count=1000
if name="" then name=left(date(),6)
delay=delay*60*30 /* delay in minutes x 60s/min x 30f/s = delay in frames */
IF ~SHOW('Libraries',TOASTERLIB) = 0 THEN
IF ~ADDLIB(TOASTERLIB , 0) THEN x=Bummer(" Please start your Video Toaster!")
Switcher(TOSW) /* Go to Switcher screen */
Switcher(LVID) /* Set to live digital video */
time(reset)
do f=0 to count
Switcher(FVID) /* Freeze frame */
SaveNextFrame(name||time(elapsed))
Switcher(LVID) /* Set to live digital video */
Switcher(FRES) /* Reset frame counter */
Switcher(WAIT,delay) /* Wait */
end
Switcher(TOWB) /* Go to Workbench screen */
exit
SaveNextFrame: Procedure
arg name
N=Switcher(STAT,KNUM) /* Get the current keypad number */
fs=N+1
do while Switcher(FMXI,fs) &fs~=N /* Is the frame already there? */
if fs=999 then fs=0 /* wrap around at last frame */
else fs=fs+1
end
if fs=N then t=10 /* got to starting frame without finding open fs */
else t=Switcher(FMSV,fs,name) /* Save frame */
say "Saved frame "name" in number "fs " at "time()
return t